home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / TeX-inputs / LaTeX / tools / dcolumn.sty < prev    next >
Text File  |  1997-03-07  |  2KB  |  72 lines

  1. %%
  2. %% This is file `dcolumn.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% dcolumn.dtx  (with options: `package')
  8. %% 
  9. %% IMPORTANT NOTICE:
  10. %% 
  11. %% This file is a generated file from the sources of the `tools' bundle
  12. %% in the LaTeX2e distribution.
  13. %% 
  14. %% For the copyright notice see the source file(s).
  15. %% 
  16. %% You are not allowed to modify this file.
  17. %% 
  18. %% You are allowed to distribute this file if and only if
  19. %% it is distributed with the corresponding source files in
  20. %% the `tools' bundle.
  21. %% 
  22. %% For the copying and distribution conditions of the source files,
  23. %% see the file readme.txt distributed with the tools bundle.
  24. %% 
  25. %% File: dcolumn.dtx Copyright (C) 1992-1996 David Carlisle
  26. \NeedsTeXFormat{LaTeX2e}
  27. \ProvidesPackage{dcolumn}
  28.           [1996/09/23 v1.04 decimal alignment package (DPC)]
  29. \RequirePackage{array}
  30. \def\DC@#1#2#3{%
  31.   \uccode`\~=`#1\relax
  32.   \m@th
  33.   \afterassignment\DC@x\count@#3\relax{#1}{#2}}
  34. \def\DC@x#1\relax#2#3{%
  35.   \ifnum\z@>\count@
  36.     \expandafter\DC@centre
  37.   \else
  38.     \expandafter\DC@right
  39.   \fi
  40.   {#2}{#3}{#1}}
  41. \def\DC@centre#1#2#3{%
  42.   \let\DC@end\DC@endcentre
  43.   \uppercase{\def~}{$\egroup\setbox\tw@=\hbox\bgroup${#2}}%
  44.   \setbox\tw@=\hbox{${\phantom{{#2}}}$}%
  45.   \setbox\z@=\hbox\bgroup$\mathcode`#1="8000 }
  46. \def\DC@endcentre{$\egroup
  47.     \ifdim \wd\z@>\wd\tw@
  48.       \setbox\tw@=\hbox to\wd\z@{\unhbox\tw@\hfill}%
  49.     \else
  50.       \setbox\z@=\hbox to\wd\tw@{\hfill\unhbox\z@}\fi
  51.     \box\z@\box\tw@}
  52. \def\DC@right#1#2#3{%
  53.   \ifx\relax#3\relax
  54.     \hfill
  55.     \let\DC@rl\bgroup
  56.   \else
  57.     \edef\DC@rl{to\the\count@\dimen@ii\bgroup\hss\hfill}%
  58.     \count@\@gobble#3\relax
  59.   \fi
  60.   \let\DC@end\DC@endright
  61.   \uppercase{\def~}{$\egroup\setbox\tw@\hbox to\dimen@\bgroup${#2}}%
  62.    \setbox\z@\hbox{$1$}\dimen@ii\wd\z@
  63.    \dimen@\count@\dimen@ii
  64.    \setbox\z@\hbox{${#2}$}\advance\dimen@\wd\z@
  65.    \setbox\tw@\hbox to\dimen@{}%
  66.    \setbox\z@\hbox\DC@rl$\mathcode`#1="8000 }
  67. \def\DC@endright{$\hfil\egroup\box\z@\box\tw@}
  68. \newcolumntype{D}[3]{>{\DC@{#1}{#2}{#3}}c<{\DC@end}}
  69. \endinput
  70. %%
  71. %% End of file `dcolumn.sty'.
  72.